﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace System
{
    /// <summary>
    /// 文件操作类
    /// </summary>
    public class CFile
    {
        /// <summary>
        /// 向指定路径文件中加入一行文本
        /// </summary>
        /// <param name="filePath">文本文件路径</param>
        /// <param name="logInfo">待加入文本</param>
        public static void WriteLine(string filePath, string logInfo)
        {
            using (StreamWriter writer = File.Exists(filePath) ? File.AppendText(filePath) : File.CreateText(filePath))
            {
                writer.WriteLine(logInfo);
                writer.Close();
            }
        }
    }
}
